var vue = new Vue({
    el: "#app",
    data: {
        /* {
            "id": 1,
            "topicName": "春节过年回家",
            "initiatorId": 1,
            "initiatorName": "admin",
            "detailIds": "1,2,3",
            "num": null,
            "detailList": null
        } */
        topic: {},
        content: "",
        id: null,
    },
    methods: {
        getTopicById: function () {
            ajaxGet("/topic/topicDetail", { id: this.id }, (data) => {
                this.topic = data.data;
                console.log(this.topic);
            });
        },
        replay: function () {
            console.log("123");
            ajaxPost(
                "/detail/replay",
                {
                    topicId: this.id,
                    userId: 1,
                    userName: "admin",
                    content: this.content,
                },
                (data) => {
                    this.getTopicById();
                }
            );
        },
    },
    filters: {},
    mounted: function () {
        let id = getParams().id;
        this.id = id;
        this.getTopicById();
    },
});
